<template>
	<view class="search">
		<view class="search-box">
					<image src="../../static/image/icons/search-active.png" mode=""></image>
				 <input class="input" confirm-type="search" placeholder="搜索" /> <text>取消</text>
		</view>
		<view class="hot-search">
			<view class="title">
				热门搜索
			</view>
			<view class="search-con">
				<view class="search-item" v-for="item in hotList">
					<image :src="item.url" mode=""></image>
					<view class="text">
						{{ item.text }}
					</view>
				</view>
			</view>
		</view>
		<view class="hot-search history">
			<view class="title">
				历史搜索
			</view>
			<view class="search-con">
				<view class="search-item" v-for="item in history">
					<view class="text">
						{{ item }}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import chuangyi from '../../static/image/icons/chuangyi.png';
	export default {
		data() {
			return {
				hotList: [
					{
						url: chuangyi,
						text: '创意'
					},
					{
						url: chuangyi,
						text: '创意'
					},
					{
						url: chuangyi,
						text: '创意'
					},
					{
						url: chuangyi,
						text: '创意'
					},
					{
						url: chuangyi,
						text: '创意'
					},
					{
						url: chuangyi,
						text: '创意'
					},
				],
				history: ['椅子', '木灯', '鞋架', '灯具']
			};
		},
		onShow() {
			uni.setNavigationBarTitle({
				title: '搜索'
			})
		}
	}
</script>

<style lang="scss">
	.search {
		width: 100%;
		height: 100vh;
		background-color: #F1ECE7;
		.search-box {
			position: relative;
			top: 20rpx;
			box-sizing: border-box;
			padding: 0 54rpx 0 72rpx;
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;
			image {
				position: absolute;
				width: 36rpx;
				height: 36rpx;
				left: 100rpx;
				top: 16rpx;
			}
			.input {
				width: 544rpx;
				height: 70rpx;
				background: #FFFFFF;
				box-shadow: 0 8rpx 16rpx 0 rgba(83,66,49,0.05);
				border-radius: 64rpx;
				box-sizing: border-box;
				padding-left: 72rpx;
			}
			text {
				font-size: 28rpx;
				color: #3E3E3E;
				letter-spacing: 2rpx;
			}
		}
		.hot-search {
			margin-top: 60rpx;
			box-sizing: border-box;
			width: 100%;
			padding: 0 42rpx;
			.title {
				font-size: 32rpx;
				color: #3E3E3E;
				letter-spacing: 2.29rpx;
				font-weight: bolder;
				margin-bottom: 47rpx;
			}
			.search-con {
				display: flex;
				flex-wrap: wrap;
				width: 100%;
				.search-item {
					width: 192rpx;
					height: 192rpx;
					background: #FFFFFF;
					box-shadow: 0 4rpx 12rpx 0 rgba(83,66,49,0.08);
					border-radius: 30rpx;
					margin-right: 43rpx;
					margin-bottom: 46rpx;
					text-align: center;
					font-size: 26rpx;
					color: #3E3E3E;
					letter-spacing: 1.86rpx;
					&:nth-child(3n) {
						margin-right: 0;
					}
					image {
						margin: 42rpx 0 14rpx 0;
						width: 42rpx;
						height: 42rpx;
					}
				}
			}
		}
		.history {
			.search-con {
				.search-item {
						width: 192rpx;
						height: 82rpx;
						display: flex;
						align-items: center;
						justify-content: center;
				}
			}
		}
	}
</style>
